<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\relation\HasMany;

/**
 * @mixin Model
 */
class Organization extends Model
{
    // 设置主键
    protected $pk = 'id';
    
    // 设置只读字段
    protected array $readonly = ['id', 'user_id'];
    
    /**
     * 关联团队成员
     */
    public function members(): HasMany
    {
        return $this->hasMany(OrganizationMembers::class, 'oid', 'id');
    }
}
